#include <iostream>
#include<vector>
using namespace std;
typedef long long LL;
const int N = 1e7;
vector<LL> prime;
bool is_prime[N + 1];
void era()
{
    for (int i = 1; i <= N; i++)
    {
        is_prime[i] = true;
    }
    for (int i = 2; i * i <= N; i++)
    {
        if (is_prime[i])
        {
            for (int j = i * i; j <= N; j+= i)
            {
                is_prime[j] = false;
            }
        }

    }
    for (int i = 2; i <= N; i++)
    {
      if(is_prime[i])
        prime.push_back(i);
    }
}
int main()
{
    era();
    cout << prime[100001] << endl;
    return 0;
}
